package com.shengqin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@TableName("t_plan_reservation")
public class Reservation {
    @TableId(type = IdType.AUTO)
    private Long id;
    private Long reservationId;
    private Integer schoolId;
    private String schoolName;
    private Integer planId;
    private String planName;
    private String name;
    private String studyCode;
    private String cardNo;
    private String idCard;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate testOfDay;
    private String testOfTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    private Integer status = 1;

    @TableField(exist = false)
    private String loginPassword;
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc(){
        return status == 1 ? "已预约" : status == 2 ? "已取消" : "";
    }
}
